package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.ClueConvertRuleEntity;
import com.xbongbong.saas.domain.entity.ext.ClueEntityExt;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author long
 * @version v1.0
 * @date 2020/11/26 13:59
 * @since v1.0
 */
@Repository
@Mapper
public interface ClueConvertRuleDao {

    /**
     * 插入数据
     *
     * @param clueConvertRuleEntity 实体数据
     **/
    Integer insert(ClueConvertRuleEntity clueConvertRuleEntity);
    /**
     * 更新数据
     *
     * @param clueConvertRuleEntity 实体数据
     **/
    Integer update(ClueConvertRuleEntity clueConvertRuleEntity);
    /**
     * 根据id查询数据
     *
     * @param key 主键
     * @param corpid 公司ID
     **/
    ClueConvertRuleEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);
    /**
     * @param param 参数map
     * @return java.lang.Integer
     */
    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    /**
     * Description: 根据条件查询customer
     * @param param 参数map
     * @return com.xbongbong.saas.domain.entity.ClueConvertRuleEntity
     */
    List<ClueConvertRuleEntity> findEntitys(@Param("param") Map<String, Object> param);

    List<ClueConvertRuleEntity> getByCorpidAndFormId(@Param("corpid") String corpid, @Param("formId") Long formId);

    ClueConvertRuleEntity getByCustomerFormId(@Param("corpid") String corpid, @Param("formId") Long formId, @Param("customerFormId") Long customerFormId);
}
